$(function(){
	var usettingx = {
		    view:{
		    	dblClickExpand: false
		    },
			check: {
			    enable: true,
			    chkboxType :{ "Y" : "s", "N" : "s" }

			},
			async : {
				enable : true,
				url : "business/component!ztreeall",
				autoParam : ["id=bean.id"],
				otherParam:{}
			   // dataFilter: filter
			}
		};

		var UzNodesx = [
		              {
		            	  name : "北方特种能源有限公司西安庆华公司",
		          		  open : true,
		          		  nocheck:true,
		          		  id:"root",
		          		  isParent:true
		              }              
		];
	var userTreeObjx = $.fn.zTree.init($("#userTree") , usettingx ,UzNodesx);
	var root = userTreeObjx.getNodes();
	userTreeObjx.expandNode(root[0]);
	$("button.translate").bind("click",function(){
		var nodes = userTreeObjx.getCheckedNodes(true);
		if(nodes.length==0){
			alert("请选择至少一个用户！");
			return;
		}
		fileType = fileType=='sent'?'received':fileType;
		var datastr = "fileType="+fileType+"&";
		for(var i=0;i<nodes.length;i++){
			var n = nodes[i];
			datastr+="tousers["+i+"]="+n.id+"&";		
		}
		datastr+=fileIds;
		//alert(datastr);
		//return;
		doPost("fileserver/file/translate-file!translate",datastr,function(){
			createNotify("传递成功,返回先前的页面!");
			selectFiles={};
			doGet(fromUrl);
			
		});
	});
});